Integrand size = 15, antiderivative size = 249 \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {b^2 \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {b^2 \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{4 c^{5/2}}-\frac {b \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {x \sin \left (a+b x+c x^2\right )}{2 c} \]
[Out]
Time = 0.35 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3545, 3543, 3529, 3433, 3432, 3528} \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}+\frac {\sqrt {\frac {\pi }{2}} b^2 \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} b^2 \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {b \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {x \sin \left (a+b x+c x^2\right )}{2 c} \]
[In]
[Out]
Rule 3432
Rule 3433
Rule 3528
Rule 3529
Rule 3543
Rule 3545
Rubi steps \begin{align*} \text {integral}& = \frac {x \sin \left (a+b x+c x^2\right )}{2 c}-\frac {\int \sin \left (a+b x+c x^2\right ) \, dx}{2 c}-\frac {b \int x \cos \left (a+b x+c x^2\right ) \, dx}{2 c} \\ & = -\frac {b \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {x \sin \left (a+b x+c x^2\right )}{2 c}+\frac {b^2 \int \cos \left (a+b x+c x^2\right ) \, dx}{4 c^2}-\frac {\cos \left (a-\frac {b^2}{4 c}\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{2 c}-\frac {\sin \left (a-\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{2 c} \\ & = -\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {b \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {x \sin \left (a+b x+c x^2\right )}{2 c}+\frac {\left (b^2 \cos \left (a-\frac {b^2}{4 c}\right )\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{4 c^2}-\frac {\left (b^2 \sin \left (a-\frac {b^2}{4 c}\right )\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx}{4 c^2} \\ & = \frac {b^2 \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {b^2 \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{4 c^{5/2}}-\frac {b \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {x \sin \left (a+b x+c x^2\right )}{2 c} \\ \end{align*}
Time = 0.47 (sec) , antiderivative size = 160, normalized size of antiderivative = 0.64 \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {-\sqrt {2 \pi } \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \left (2 c \cos \left (a-\frac {b^2}{4 c}\right )+b^2 \sin \left (a-\frac {b^2}{4 c}\right )\right )+\sqrt {2 \pi } \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \left (b^2 \cos \left (a-\frac {b^2}{4 c}\right )-2 c \sin \left (a-\frac {b^2}{4 c}\right )\right )+2 \sqrt {c} (-b+2 c x) \sin (a+x (b+c x))}{8 c^{5/2}} \]
[In]
[Out]
Time = 1.85 (sec) , antiderivative size = 204, normalized size of antiderivative = 0.82
method | result | size |
default | \(\frac {x \sin \left (c \,x^{2}+b x +a \right )}{2 c}-\frac {b \left (\frac {\sin \left (c \,x^{2}+b x +a \right )}{2 c}-\frac {b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {C}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {S}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\right )}{2 c}-\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {S}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )-\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {C}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\) | \(204\) |
risch | \(\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right )}{16 c^{2} \sqrt {i c}}-\frac {i \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right )}{8 c \sqrt {i c}}-\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right )}{16 c^{2} \sqrt {-i c}}-\frac {i \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}} \operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right )}{8 c \sqrt {-i c}}-2 i \left (\frac {i x}{4 c}-\frac {i b}{8 c^{2}}\right ) \sin \left (c \,x^{2}+b x +a \right )\) | \(245\) |
parts | \(\frac {\sqrt {2}\, \sqrt {\pi }\, x^{2} \cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {C}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )}{2 \sqrt {c}}+\frac {\sqrt {2}\, \sqrt {\pi }\, x^{2} \sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {S}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )}{2 \sqrt {c}}-\frac {\sqrt {2}\, \pi ^{\frac {3}{2}} \left (\frac {\cos \left (\frac {4 a c -b^{2}}{4 c}\right ) \left (\operatorname {C}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \left (\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2} \sqrt {\pi }\, \sqrt {c}-\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \sqrt {2}\, b \right )-\frac {\sqrt {c}\, \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \sin \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\sqrt {\pi }}+\frac {\sqrt {c}\, \operatorname {S}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )}{\sqrt {\pi }}+\frac {\sqrt {2}\, b \sin \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\pi }\right )}{\sqrt {\pi }\, \sqrt {c}}-\frac {\sin \left (\frac {4 a c -b^{2}}{4 c}\right ) \left (\operatorname {S}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \left (\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2} \sqrt {\pi }\, \sqrt {c}-\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \sqrt {2}\, b \right )+\frac {\sqrt {c}\, \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right ) \cos \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\sqrt {\pi }}-\frac {\sqrt {c}\, \operatorname {C}\left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )}{\sqrt {\pi }}-\frac {\sqrt {2}\, b \cos \left (\frac {\pi \left (\frac {\sqrt {2}\, \sqrt {c}\, x}{\sqrt {\pi }}+\frac {\sqrt {2}\, b}{2 \sqrt {\pi }\, \sqrt {c}}\right )^{2}}{2}\right )}{\pi }\right )}{\sqrt {\pi }\, \sqrt {c}}\right )}{4 c^{\frac {3}{2}}}\) | \(602\) |
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 173, normalized size of antiderivative = 0.69 \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {\sqrt {2} {\left (\pi b^{2} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - 2 \, \pi c \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) - \sqrt {2} {\left (\pi b^{2} \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + 2 \, \pi c \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + 2 \, {\left (2 \, c^{2} x - b c\right )} \sin \left (c x^{2} + b x + a\right )}{8 \, c^{3}} \]
[In]
[Out]
\[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\int x^{2} \cos {\left (a + b x + c x^{2} \right )}\, dx \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 1.07 (sec) , antiderivative size = 1570, normalized size of antiderivative = 6.31 \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\text {Too large to display} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.34 (sec) , antiderivative size = 227, normalized size of antiderivative = 0.91 \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=-\frac {-\frac {i \, \sqrt {2} \sqrt {\pi } {\left (b^{2} + 2 i \, c\right )} \operatorname {erf}\left (-\frac {1}{4} i \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{4 \, c}\right )}}{{\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 \, {\left (c {\left (-2 i \, x - \frac {i \, b}{c}\right )} + 2 i \, b\right )} e^{\left (i \, c x^{2} + i \, b x + i \, a\right )}}{16 \, c^{2}} - \frac {\frac {i \, \sqrt {2} \sqrt {\pi } {\left (b^{2} - 2 i \, c\right )} \operatorname {erf}\left (\frac {1}{4} i \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{4 \, c}\right )}}{{\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 \, {\left (c {\left (2 i \, x + \frac {i \, b}{c}\right )} - 2 i \, b\right )} e^{\left (-i \, c x^{2} - i \, b x - i \, a\right )}}{16 \, c^{2}} \]
[In]
[Out]
Timed out. \[ \int x^2 \cos \left (a+b x+c x^2\right ) \, dx=\int x^2\,\cos \left (c\,x^2+b\,x+a\right ) \,d x \]
[In]
[Out]